<?php
namespace app\index\controller;

use think\Response;

abstract class Base
{
    protected $page;
    protected $pageSize;
    
    public function __construct()
    {
        $this->page = (int)request()->param('page');
        $this->pageSize = (int)request()->param('page_size');
    }

    protected function create($data,$msg = '',$code = 200,$type = 'json')
    {
        $result = [
            'code'  =>  $code,
            'msg'   =>  $msg,
            'data'  =>  $data
        ];
        return Response::create($result,$type);
    }
}